const user = {
    index: true,
    border: true,
    stripe: true,
    menuAlign: 'center',
    loadingText: "加载中...",
    loadingSpinner: "svg",
    loadingSvgViewBox: "-10, -10, 50, 50",
    loadingBackground: "rgba(122, 122, 122, 0.6)",
    labelWidth: 120,
    menu: true,
    menuWidth: 120,
    addBtn: false,
    delBtn: false,
    editBtn: false,
    column: [
        {
            label:'用户ID',
            prop: "userId",
            minWidth: 100,
            search: true
        },
        {
          label: "游戏编码",
          prop: "gameCode",
          minWidth: 100,
          search: true
        },
        {
          label: "动账前",
          prop: "beforeGold",
          formatter: (row, value, column) => {
            return row.beforeGold / 100;
          },
        },
        {
          label: "动账后",
          prop: "afterGold",
          formatter: (row, value, column) => {
            return row.afterGold / 100;
          },
        },
        {
          label: "金额变化",
          prop: "changeGold",
          formatter: (row, value, column) => {
            return row.changeGold / 100;
          },
        },
    
        {
          label: "动账时间",
          prop: "createdAt",
          minWidth: 130,
          formatter: (row, value, column) => {
            return formatDate(row.createdAt * 1000, "-");
          },
        },
        {
          label: "原因",
          prop: "reason",
          minWidth: 130,
          search: true,
          searchType: "select",
          dicData: [
            { label: 'Active spin', value: 'Active spin' },
            { label: '输赢', value: '输赢' },
            { label: '下注', value: '下注' },
            { label: '前台充值', value: '前台充值' },
            { label: '后台充值', value: '后台充值' },
            { label: '提现', value: '提现' },
            { label: '活动奖励_spin', value: '活动奖励_spin' },
            { label: '邀请好友活动', value: '邀请好友活动' },
            { label: '活动奖励', value: '活动奖励' },
            { label: '推广', value: '推广' },
            { label: '回滚', value: '回滚' },
            { label: '调整', value: '调整' },
            { label: '兑换码', value: 'exchange' },
            { label: '首充活动奖励', value: '首充活动奖励' },
          ]
        },
      ],
}

const formatDate = (date, cut) => {
    var date = new Date(date);
    var YY = date.getFullYear() + cut;
    var MM =
        (date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1) + cut;
    var DD = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
    var hh = (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
    var mm = (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + ":";
    var ss = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
    return YY + MM + DD + " " + hh + mm + ss;
};

export default user